// 1.引入 Vue
import Vue from "vue";

// 2.引入 vueRouter
import VueRouter from "vue-router";

const NotFind = () => import("@/components/404");
const Authentication = () => import("@/components/Authentication")

const Count = () => import("@/views/Count");
const Movie = () => import("@/views/Movie");

/* import NotFind from '@/components/404'

import Count from '@/views/Count'
import Movie from '@/views/Movie' */

// 3.使用路由插件
Vue.use(VueRouter);

// 4.创建路由
const routes = [
  {
    path: "/",
    component: Authentication,
    children: [
      { path: "/count", component: Count },
      { path: "/movie", component: Movie },
    ],
  },
  {
    path: "*",
    component: NotFind,
  },
];

export default new VueRouter({
  mode: "history",
  routes,
});
